/* Element Plus */
import type { App } from 'vue'
import ElementPlus from 'element-plus'

// Element Plus stylesheets
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// @ts-ignore
// Element Plus i18n
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

// Export setup function
export const setupElementPlus = (app: App) => {
  app.use(ElementPlus, {
    locale: zhCn
  })
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
}
